import MessageBox from "@/components/MessageBox.vue";
import { createApp } from "vue";
export default function showMsg(msg = "这是标题", handleClick) {
  console.log(msg);
  const app = createApp(MessageBox, {
    msg: msg,
    onclick: handleClick,
  });
  const div = document.createElement("div");
  app.mount(div);
  document.body.appendChild(div);
  // 返回一个关闭弹窗函数
  return () => {
    app.unmount(div);
    div.remove();
  };
}
